import createAxiosInstance from '@/axios/request';

const attendanceTypesApi = createAxiosInstance('/api/attendance-types')

// 考勤类型相关API
export const attendanceTypeApi = {
  // 获取考勤类型列表
  getAttendanceTypes: () => {
    return attendanceTypesApi.get('/')
  },
  
  // 创建考勤类型
  createAttendanceType: (data: any) => {
    return attendanceTypesApi.post('/', data)
  },
  
  // 批量创建考勤类型
  batchCreateAttendanceTypes: (data: any[]) => {
    return attendanceTypesApi.post('/batch', data)
  },
  
  // 更新考勤类型
  updateAttendanceType: (id: number, data: any) => {
    return attendanceTypesApi.put(`/${id}`, data)
  },
  
  // 删除考勤类型
  deleteAttendanceType: (id: number) => {
    return attendanceTypesApi.delete(`/${id}`)
  }
}